package top.zhangjianyong.tools.timer;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import top.zhangjianyong.tools.entity.HotVideo;
import top.zhangjianyong.tools.service.api.FreeApiService;
import top.zhangjianyong.tools.service.mybatis.IHotVideoService;

/**
 * @author ： zhangjianyong
 * @date ： 2023/3/6 3:49 PM
 */
@Slf4j
@Component
public class HotVideoTimer {
    @Autowired
    private IHotVideoService iHotVideoService;
    @Autowired
    private FreeApiService freeApiService;

    @Scheduled(cron = "0 0 */3 * * ?")
    public void doTimer() {
        log.info("更新热门视频");
        freeApiService.hotVideoUpdateAll();
    }
}
